package org.linlinjava.litemall.db.dao.order_manage;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.dao.AgedmallHospitalSendSelfLocationEquMapper;
import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.vo.app.PromoterOrderTitleDto;
import org.linlinjava.litemall.db.vo.order_manage.PromoterStaticDetailIVo;
import org.linlinjava.litemall.db.vo.order_manage.PromoterstatisticalInfo;
import org.linlinjava.litemall.db.vo.shop.ChainLockPickup;
import org.linlinjava.litemall.db.vo.shop.MedicalLockPickup;
import org.linlinjava.litemall.db.vo.shop.StoreCloudPickup;
import org.linlinjava.litemall.db.vo.shop.*;
import org.linlinjava.litemall.db.vo.store.GoodsListVo;
import org.linlinjava.litemall.db.vo.wechat.SeparateWechatData;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

/**
 * @author wj
 * @date 2021/8/6 9:25
 */
public interface AgedmallShopMapper {
    List<AgedmallBusinessInfo> getShopListByUserId(String id);

    int insertClassifyBatch(List<AgedmallClassify> list);

    List<ClassifyListDto> getClassifyList();

    Integer getExtensionOrderCount(@Param("sId") Integer sId);

    BigDecimal getExtensionOrderPriceCount(@Param("sId") Integer sId);

    Integer getExtensionCustomerCount(@Param("sId") Integer sId);

    Integer getExtensionPromoteCustomerCount(@Param("sId") Integer sId);

    Integer getgetExtensionNotRegisterCustomerCount();

    Integer getUserClickCount();

    BigDecimal getExtensionCommissionCount(@Param("sId") Integer sId);

    BigDecimal getExtensionIsSettlementPrice(@Param("id") Integer id, @Param("userId") Integer userId);

    BigDecimal getExtensionIsSettlementPriceCount(@Param("sId") Integer sId);

    BigDecimal getExtensionUnSettlementPrice(@Param("sId") Integer sId);

    ExtensionInfoDto getPromoteListCount(@Param("sId") Integer sId);

    List<PromoterListBackDto> selectPromoterList(@Param("shopId") Integer shopId, @Param("keySearch") String keySearch);

    BigDecimal getWithdrawalPriceByUserId(Integer id);

    List<ExtensionOrderListBackDto> selectOrderInfoByUserId(@Param("id") Integer id, @Param("keySearch") String keySearch,
                                                            @Param("state") Integer state);

    List<ExtensionGoodsDto> ExtensionOrderGoodsList(@Param("ids") List<Integer> ids);

    List<ExtensionUserDto> selectExtensionUsersById(Integer id);

    List<CustomTemplateListDto> selectCustomTemplateList(@Param("shopId") Integer shopId, @Param("keySearch") String keySearch);

    List<CustomGoodsListDto> selectCustomGoodsList(@Param("shopId") Integer shopId, @Param("firstId") Integer firstId,
                                                   @Param("secondId") Integer secondId,
                                                   @Param("state") Integer state, @Param("keySearch") String keySearch);

    List<CustomGoodsListDto> selectUnCustomGoodsList(@Param("shopId") Integer shopId, @Param("firstId") Integer firstId,
                                                     @Param("secondId") Integer secondId,
                                                     @Param("state") Integer state,
                                                     @Param("keySearch") String keySearch);

    List<AgedmallCustomTemplate> selectCustomGoodsListByGoodsId(String goodsId);

    int updateCustomTemplateBatch(List<AgedmallCustomTemplate> customTemplates);

    List<LitemallGoods> selectGoodsListBySearchGoods(@Param("storeIds") List<Integer> storeIds, @Param("goodsIds") List<Integer> goodsIds);

    List<FreightTemplateDto> selectFreightTemplateListByType(@Param("type") Integer type, @Param("keySearch") String keySearch, @Param("shopId") Integer shopId);

    List<ChargeTemplateDto> selectChargeTemplateList(@Param("keySearch") String keySearch, @Param("shopId") Integer shopId);

    List<MaintainTemplateDto> selectMaintainTemplateList(@Param("shopId") Integer shopId, @Param("keySearch") String keySearch
            , @Param("type") Integer type);

    void insertCloudGoodsProductBatch(List<AgedmallCloudGoodsProduct> list);

    List<CloudGoodsListVo> selectCloudGoodsList(@Param("id") Integer id, @Param("typeOne") Integer typeOne, @Param("typeTwo") Integer typeTwo, @Param("name") String name, @Param("state") Integer state);

    int updateCloudGoodsProductBatch(List<AgedmallCloudGoodsProduct> list);

    int insertTagsBatch(List<AgedmallTags> tags);

    List<TagsGoodsListDto> selectTagsGoodsCount(Integer id);

    int updateCouldGoodsStockBatch(@Param("num") Integer num, @Param("cloudId") Integer cloudId, @Param("ids") List<Integer> ids);

    List<SearchStoreListDto> selectStoreGoodsListByGoods(@Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("areaId") Integer areaId, @Param("busiId") Integer busiId, @Param("ids") List<Integer> ids);


    List<AgedmallClassify> getClassifyAllListParent();

    List<AgedmallClassify> getClassifyAllListChildren();

    int insertCustomGoodsBatch(List<AgedmallCustomGoods> customGoods);

    int updateCustomGoodsBatch(List<AgedmallCustomGoods> customGoods);

    List<StoreAnnoListDto> selectStoreAnnoList(@Param("shopId") Integer shopId, @Param("storeId") Integer storeId,
                                               @Param("type") Integer type,
                                               @Param("startTime") LocalDateTime startTime
            , @Param("endTime") LocalDateTime endTime
            , @Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId, @Param("areaId") Integer areaId,
                                               @Param("stat") Integer stat, @Param("num") String num);

    List<AnnoDetailBackDto> getAnnoDetailList(@Param("num") String num, @Param("storeId") Integer storeId,
                                              @Param("icCard") String icCard,
                                              @Param("orderCode") String orderCode
            , @Param("orderType") Integer orderType
            , @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<AgedmallOnlineService> selectTagsUseInOnlineService(String tag);

    List<String> selectGoodsTags();

    List<StoreGoodsInventoryDto> getStoreGoodsInventory(@Param("id") Integer id);

    List<OnlineServiceTagsDto> getOnlineServiceTagsCount();

    List<OnlineServiceClassifyDto> getOnlineServiceClassifyCount();

    List<NotInCloudGoodsDto> getNotInCloudGoodsList(@Param("cloudId") Integer cloudId, @Param("shopId") Integer shopId,
                                                    @Param("firstId") Integer firstId,
                                                    @Param("secondId") Integer secondId,
                                                    @Param("state") Integer state,
                                                    @Param("keySearch") String keySearch);

    SeparateWechatData getStoreMessageByOrderGoodsId(Integer id);

    List<SeparateWechatData> getStoreMessageByOrderGoodsList(@Param("list") List<Integer> list);

    String getdeliveryManNameByICcard(@Param("rfid") String rfid);

    List<HospitalSendDto> getHospitalSendList(@Param("shopId") Integer shopId, @Param("provinceId") Integer provinceId,
                                              @Param("cityId") Integer cityId, @Param("villageId") Integer villageId,
                                              @Param("keySearch") String keySearch);

    List<GoodsListVo> getStoreGoodsListByStoreIds(@Param("list") List<Integer> list);

    List<ClassifyOnlineCountDto> selectClassifyOnlineCount();


    List<ChainLockPickup> selectEquGoodsMessage(@Param("list") List<Integer> list);

    List<MedicalLockPickup> selectMedicalLockGoodsMessage(@Param("list") List<String> list);

    List<StoreCloudPickup> selectStoreGoodsMessage(@Param("list") List<Integer> list);

    List<StoreCloudPickup> selectCloudGoodsMessage(@Param("list") List<Integer> list);

    int insertGoodsAttributeList(@Param("list") List<AgedmallHospitalSendGoodsAttribute> list);

    List<HospitalSendDto> getOtherHospitalSendList(@Param("parentId") Integer parentId);

    List<HospitalSendGoodsDto> getHospitalGoodsAttribute(@Param("list") List<Integer> list, @Param("hospitalId") Long hospitalId);

    List<HospitalChannelLinkBackDto> selectHospitalChannelLinkList(@Param("hospitalId") Long hospitalId, @Param("keySearch") String keySearch);

    int insertStoreAttributeList(@Param("list") List<AgedmallHospitalSendStoreAttribute> list);

    /**
     * 据推广表自增id查询
     *
     * @param promoteId
     * @return
     */
    PromoteUserInfoDto getPromoteInfo(@Param("promoteId") Integer promoteId);

    /**
     * 根据推广员id统计相关订单
     *
     * @param promoteId
     * @return
     */
    PromoteOrderNumberDto getPromoteOrder(@Param("promoteId") Integer promoteId);

    /**
     * 统计某个推广员的推荐的客户列表
     *
     * @param promoteId
     * @return
     */
    List<PromoteCustomerSaleDto> getCustomerSaleInfo(@Param("promoteId") Integer promoteId);


    /**
     * 获取推广统计
     *
     * @param promoterStaticDetailIVo
     * @return
     */
    List<PromoterstatisticalInfo> getPromoterStatistical(PromoterStaticDetailIVo promoterStaticDetailIVo);


    /**
     * 获取推广员推荐的下单信息
     *
     * @param
     * @return
     */
    List<promoterOrderInfo> getUserOrderRecommendInfo(@Param("promoteId") Integer promoteId, @Param("keySearch") String keySearch);

    /**
     * 查询推广订单信息
     *
     * @param ids
     * @return
     */
    List<PromoterCommissionOrder> getPromoterOrderInfo(@Param("ids") List<Integer> ids, @Param("type") Integer type);

    int insertSelfLocationAttributeList(@Param("list") List<AgedmallHospitalSendSelfLocation> list);

    int insertHospitalGoodsEquRelationList(@Param("list") List<AgedmallHospitalSendSelfLocationEqu> list);

    int insertHospitalGoodsEquList(@Param("list") List<AgedmallGoodsEqu> list);

    int updateSelfLocationAttributeList(@Param("list") List<AgedmallHospitalSendSelfLocation> list);

    List<HospitalGoodsProductDto> selectStoreGoodsProductByStoreGoodsId(@Param("list") List<Integer> list);

    List<HospitalSelfLocationEquVo> getEquListByHospitalSend(@Param("id") Long id);

    List<PromoterCommissionOrder> getPromoterOrderInfo(@Param("ids") Set<Integer> ids, @Param("type") Integer type);

    int insertLeasePeriodList(@Param("list") List<AgedmallChargeTemplateLeasePeriod> list);

    int updateLeasePeriodList(@Param("list") List<AgedmallChargeTemplateLeasePeriod> list);
}
